<Window x:Class="P2.Cuberry.Modules.Clinicom.CCPatient.CCPatientsDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper" 
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="920" Height="480"  
        Background="{DynamicResource P2BackgroundBrush}" 
        Closing="Window_Closing"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Clinicom.CCPatient;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Clinicom.CCPatient;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Clinicom.CCPatient;component/Images/save.png" />

            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Clinicom.CCPatient;component/Images/printer2.png" />


        </Grid.Resources>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderCCPatientDetail}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Grid>
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn" Margin="2,1,0,2"  InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding CCPatientSaveCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding CCPatientCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                                
                <MenuItem x:Name="PrintBtn" Margin="2,1,0,2" Header="{Translate PrintBtn}" Click="PrintBtn_Click" Icon="{StaticResource Printer2Icon}" Style="{StaticResource P2MenuItemStyle}"/>
                </Menu>
                <Menu Grid.Row="1" HorizontalAlignment="Right" x:Name="menuMainRight" Style="{StaticResource P2MenuStyle}" >
                    <MenuItem x:Name="HistoryBtn" Command="{Binding HistoryCommand}"  Style="{StaticResource P2MenuItemStyleHistory}"/>
                    <MenuItem x:Name="InfoBtn" Command="{Binding InfoCommand}"  Style="{StaticResource P2MenuItemStyleInfo}"/>
                </Menu>
            </Grid>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Label Margin="10,3,0,0" Name="FirstNameEnL" Height="28" VerticalAlignment="Top" Content="{Translate FirstNameEnL}" HorizontalAlignment="Left" Width="120"></Label>  
                <TextBox Margin="100,6,0,0" Name="FirstNameEn" Height="23" Text="{Binding Model.FirstNameEn, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  
Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="230" /> 

                <Label Margin="10,33,0,0" Name="MiddleNameEnL" Height="28" VerticalAlignment="Top" Content="{Translate MiddleNameEnL}" HorizontalAlignment="Left" Width="120"></Label>  
                <TextBox Margin="100,36,0,0" Name="MiddleNameEn" Height="23" Text="{Binding Model.MiddleNameEn, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  
Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="230" /> 

                <Label Margin="10,63,0,0" Name="LastNameEnL" Height="28" VerticalAlignment="Top" Content="{Translate LastNameEnL}" HorizontalAlignment="Left" Width="120"></Label>  
                <TextBox Margin="100,66,0,0" Name="LastNameEn" Height="23" Text="{Binding Model.LastNameEn, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  
Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="230" /> 

                <Label Margin="10,93,0,0" Name="StreetL" Height="28" VerticalAlignment="Top" Content="{Translate StreetL}" HorizontalAlignment="Left" Width="120"></Label>  
                <TextBox Margin="100,96,0,0" Name="Street" Height="23" Text="{Binding Model.Street, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  
Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="230" /> 

                <Label Margin="10,123,0,0" Name="CityL" Height="28" VerticalAlignment="Top" Content="{Translate CityL}" HorizontalAlignment="Left" Width="120"></Label>  
                <TextBox Margin="100,126,0,0" Name="City" Height="23" Text="{Binding Model.City, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  
Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="230" />

                <Label Margin="10,154,0,0" Content="{Translate CountryIDL}" Name="CountryIDL" Height="28" VerticalAlignment="Top" HorizontalAlignment="Left" Width="101" />
                <ComboBox Margin="100,157,0,0" DisplayMemberPath="XConfigCountryCur" Name="CountryID" SelectedValuePath="CountryID" SelectedValue="{Binding CountryID,  
ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" ItemsSource="{Binding XConfigCountrys}" IsEnabled="{Binding IsEditable}" Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" Width="230" />

                <TabControl Margin="341,3,3,3" Name="tabControl1" MinWidth="540" MinHeight="317" BorderBrush="{DynamicResource P2BackgroundBrush}"   VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                    <TabItem Header="{Translate AddressTab}" Name="AddressTab" Background="White" >
                        
                        <Grid Grid.Row="1" Grid.Column="0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>

                            <Border Grid.Row="0" Margin="5,14,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                                <Grid ShowGridLines="False">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="20"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="34"/>
                                    </Grid.RowDefinitions>

                                    <DataGrid Grid.Row="1"  Margin="3,0,3,0" 
                                         Name="HRPayrollItemList" 
                                         ItemsSource="{Binding cPayrollItems}"                                         
                                                                                  
                                         Style="{DynamicResource CuberryDataGridStyle}"
                                         VerticalAlignment="Top">

                                        <DataGrid.Columns>
                                            <DataGridTextColumn   Header="{Translate PayrollCodeNoL}" IsReadOnly="True"  Binding="{Binding PayrollCodeNo}" 
                                                              Width="100" MinWidth="40" />
                                            <DataGridTextColumn   Header="{Translate PayrollCodeNameL}" IsReadOnly="True"  Binding="{Binding PayrollCodeNameCur}" 
                                                              Width="200" MinWidth="40" />
                                            <DataGridTextColumn Header="{Translate PaymentDescriptionL}" IsReadOnly="True" Binding="{Binding Path=PaymentDescription}" Width="200" MinWidth="40" />
                                            <DataGridTextColumn Header="{Translate PaymentAmountL}" IsReadOnly="True" Binding="{Binding Path=PaymentAmount, StringFormat=F2}" Width="*" />

                                        </DataGrid.Columns>
                                    </DataGrid>
                                    <Button Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom"  Margin="3,0,0,3" Name="AddPayrollItemBtn"  Command="{Binding HRPayrollAddPayrollItemCommand}"  Height="23" Width="23">
                                        <Image  Source="/P2.Cuberry.Modules.SimpleAccounting.HRPayroll;component/Images/add.png"></Image>
                                    </Button>
                                    <Button Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="28,0,0,3" Name="DeletePayrollItemBtn"  Command="{Binding HRPayrollDeletePayrollItemCommand}" Height="23"  Width="23">
                                        <Image  Source="/P2.Cuberry.Modules.SimpleAccounting.HRPayroll;component/Images/Remove.ico"></Image>
                                    </Button>
                                </Grid>
                            </Border>
                        </Grid>
                    </TabItem>
                    
                    <TabItem Header="{Translate OfficeTab}" Name="OfficeTab" Background="White" >                    
                        <Grid  Background="White" >
                            
                        </Grid  >                        
                    </TabItem>
                </TabControl>
                
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>